<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>选课信息</title>
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/css/dsb.css">
</head>
<body>

<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                    aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand one-pan-link-mark" href="/logout/">退出登陆</a>
        </div>

    </div>
</nav>

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
            <ul class="nav nav-sidebar">
                <li class=""><a href="/index" class="one-pan-link-mark">基本信息</a></li>
                <li class="active"><a href="/course" class="one-pan-link-mark">选课信息</a></li>
                <li class=""><a href="/mark" class="one-pan-link-mark">成绩信息</a></li>
                <li class=""><a href="/money" class="one-pan-link-mark">消费信息</a></li>
                <li class=""><a href="/book" class="one-pan-link-mark">图书借阅</a></li>
                <li class=""><a href="/all_books/" class="one-pan-link-mark">图书管理</a></li>
                <li class=""><a href="/course_manage" class="one-pan-link-mark">课程管理</a></li>
            </ul>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <div class="d-flex justify-content-between align-items-center">
                <h2 class="sub-header" style="display: inline-block; margin-right: 20px;">选课信息</h2>
                <div style="display: inline-block;">
                    <a href="/select_course/" class="btn btn-success">选择课程</a>
                </div>
            </div>
            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>课程号</th>
                        <th>课程名</th>
                        <th>任课教师</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% if courses %}
                        {% for course in courses %}
                        <tr>
                            <td>{{ course.co_num }}</td>
                            <td>{{ course.co_name }}</td>
                            <td>{{ course.co_teacher }}</td>
                            <td>
                                <a href="/edit_course/{{ course.co_num }}/" class="btn btn-primary btn-sm">修改</a>
                                <a href="/del_course/{{ course.co_num }}/" class="btn btn-danger btn-sm">删除</a>
                            </td>
                        </tr>
                        {% endfor %}
                    {% else %}
                        <tr>
                            <td colspan="4" class="text-center">暂无选课信息</td>
                        </tr>
                    {% endif %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

</body>
</html>